var layer = layui.layer
    ,table = layui.table
    ,$ = layui.jquery,form=layui.form;

table.render({
    elem: '#spzxtable'
    //,data:data1
   // ,toolbar: '#toolbarDemo'
    ,typ:"get"
    ,url:"process/queryToDoTasksCount"
    ,cols: [[
       // {checkbox: true, fixed: true}
        //{field:'id', width:50, fixed: true, hide:true}
        {field:'sptype', title:'审批类型',fixed:true, width:120}
        ,{field:'spcount', title:'审批条数',align: 'center', fixed: true,width:90}
        /*,{field:'code', title:'用户编码', sort: true, width:150}
        ,{field:'roles', title:'角色', fixed: true, width:300}
        ,{field:'right', title:'关联',align: 'center',toolbar:'#usererelevance', width:150}*/
        ,{fixed: 'right',  align:'center', toolbar: '#spsearch', title:'操作'}
    ]]
    ,id: 'sptableid'
    ,height: $(document).height() - $('#spzxtable').offset().top - 50
    ,page: false
});
//修改、查看
table.on('tool(spzxtable)', function(obj){
    var data = obj.data;
    if(obj.event === 'spdb') {
        parent.intab("views/jsp/SystemCenter/spdb.jsp?processKey="+data.processKey,"待办");
    }
   /* else if(obj.event === 'customerstname' || obj.event === 'cucustomerscode' || obj.event === 'referred') {
        parent.intab("views/jsp/BasicData/tpl/viewcustomerinfo.jsp?id="+obj.data.id,"客户信息")
    }*/
});